<?php

class Vega_Module_AjaxReturn {
	
	public $error = null;
	public $message = null;
	public $output = null;
	public $param = null;
	
	public function setError($error, $message) {
		$this->error = $error;
		$this->message = $message;
	}
	
	//WARNING: this function causes a recursion error
	public function buildOutput($type = 'json') {
		switch (strtolower($type)) {			
			default:
				return json_encode($this);
		}
	}
}